#ifndef __SmartHomeMonitorServer_H
#define __SmartHomeMonitorServer_H

#include "TcpServer.h"
#include "ThreadPool.h"
namespace SOS{
class SmartHomeMonitorServer{
public:
    SmartHomeMonitorServer(int threadNum, int taskSize, unsigned short port, const string & ip = "0.0.0.0");
    ~SmartHomeMonitorServer();
    void start();
    void stop();
private:
    void onConnection(SOS::TcpConnectionPtr);
    void onMessage(SOS::TcpConnectionPtr);
    void onClose(SOS::TcpConnectionPtr);
private:
    ThreadPool _threadpool;
    TcpServer _tcpServer;
};

}//end of namespace SOS
#endif